package icu.thatyear.main.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author Cjy
 * @since 2024-12-06
 */
@Getter
@Setter
@TableName("tz_order")
@Schema(name = "TzOrder", description = "订单表")
public class TzOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "订单ID")
    @TableId(value = "order_id", type = IdType.AUTO)
    private Long orderId;

    @Schema(description = "店铺id")
    @TableField("shop_id")
    private Long shopId;

    @Schema(description = "产品名称,多个产品将会以逗号隔开")
    @TableField("prod_name")
    private String prodName;

    @Schema(description = "订购用户ID")
    @TableField("user_id")
    private String userId;

    @Schema(description = "订购流水号")
    @TableField("order_number")
    private String orderNumber;

    @Schema(description = "总值")
    @TableField("total")
    private BigDecimal total;

    @Schema(description = "实际总值")
    @TableField("actual_total")
    private BigDecimal actualTotal;

    @Schema(description = "支付方式 0 手动代付 1 微信支付 2 支付宝")
    @TableField("pay_type")
    private Integer payType;

    @Schema(description = "订单备注")
    @TableField("remarks")
    private String remarks;

    @Schema(description = "订单状态 1:待付款 2:待发货 3:待收货 4:待评价 5:成功 6:失败")
    @TableField("status")
    private Integer status;

    @Schema(description = "配送类型")
    @TableField("dvy_type")
    private String dvyType;

    @Schema(description = "配送方式ID")
    @TableField("dvy_id")
    private Long dvyId;

    @Schema(description = "物流单号")
    @TableField("dvy_flow_id")
    private String dvyFlowId;

    @Schema(description = "订单运费")
    @TableField("freight_amount")
    private BigDecimal freightAmount;

    @Schema(description = "用户订单地址Id")
    @TableField("addr_order_id")
    private Long addrOrderId;

    @Schema(description = "订单商品总数")
    @TableField("product_nums")
    private Integer productNums;

    @Schema(description = "订购时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "订单更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @Schema(description = "付款时间")
    @TableField("pay_time")
    private LocalDateTime payTime;

    @Schema(description = "发货时间")
    @TableField("dvy_time")
    private LocalDateTime dvyTime;

    @Schema(description = "完成时间")
    @TableField("finally_time")
    private LocalDateTime finallyTime;

    @Schema(description = "取消时间")
    @TableField("cancel_time")
    private LocalDateTime cancelTime;

    @Schema(description = "是否已经支付，1：已经支付过，0：，没有支付过")
    @TableField("is_payed")
    private Boolean isPayed;

    @Schema(description = "用户订单删除状态，0：没有删除， 1：回收站， 2：永久删除")
    @TableField("delete_status")
    private Integer deleteStatus;

    @Schema(description = "0:默认,1:在处理,2:处理完成")
    @TableField("refund_sts")
    private Integer refundSts;

    @Schema(description = "优惠总额")
    @TableField("reduce_amount")
    private BigDecimal reduceAmount;

    @Schema(description = "订单类型")
    @TableField("order_type")
    private Byte orderType;

    @Schema(description = "订单关闭原因 1-超时未支付 2-退款关闭 4-买家取消 15-已通过货到付款交易")
    @TableField("close_type")
    private Byte closeType;
}
